import 'package:json_annotation/json_annotation.dart';

part 'store_message.g.dart';

@JsonSerializable()
class StoreMessage {
  int storeId;

  int parentId;

  String parentAll;

  String storeName;

  String ctime;

  String utime;

  String openTime;

  String closeTime;

  int storeStatus;

  int isMemberPrice;

  String province;

  String city;

  String district;

  String addressDetail;

  String houseNumber;

  int storeTypeId;

  String storeTypeName;

  String storeNo;

  String phone;

  int isBind;

  String cityCode;

  String districtCode;

  String provinceCode;

  String storeHeadImage;

  String latitude;

  String longitude;

  String email;

  String get businessArea {
    return '$province $city $district';
  }

  StoreMessage({
    this.storeId,
    this.parentId,
    this.parentAll,
    this.storeName,
    this.ctime,
    this.utime,
    this.openTime,
    this.closeTime,
    this.storeStatus,
    this.isMemberPrice,
    this.province,
    this.city,
    this.district,
    this.addressDetail,
    this.storeTypeId,
    this.storeTypeName,
    this.storeNo,
    this.phone,
    this.isBind,
    this.storeHeadImage,
    this.districtCode,
    this.cityCode,
    this.provinceCode,
    this.email,
  });

  factory StoreMessage.fromJson(Map<String, dynamic> srcJson) => _$StoreMessageFromJson(srcJson);

  Map<String, dynamic> toJson() => _$StoreMessageToJson(this);

  String get address {
    return '${province ?? ''}${city ?? ''}${district ?? ''}${addressDetail ?? ''}${houseNumber ?? ''}';
  }
}
